#ifndef MODEL_ONE_OCCURENCE_RULE_HPP
#define MODEL_ONE_OCCURENCE_RULE_HPP

#include "Model/Calendar.hpp"

namespace Model
{

	/// \brief It provides a rule that adds one defined interval range to the occupied periods.
	class MODEL_API OneOccurenceRule: public Calendar::Rule
	{
	public:
		OneOccurenceRule();
		OneOccurenceRule( const Calendar::Time& start, const Calendar::Time& end);

		void setInterval( const Calendar::Time& start, const Calendar::Time& end) { this->setInterval( Calendar::PeriodSet::traits_type::make_interval( start, end)); }
		void setInterval( const Calendar::Period& period) { period_ = period; }
		const Calendar::Period& period() const { return period_; }

		/// \sa Calendar::Rule::getPeriods( const Calendar::Time&, const Calendar::Time&, Calendar::PeriodSet&);
		virtual void getPeriods( const Calendar::Time& start, const Calendar::Time& end, Calendar::PeriodSet& out);

	private:
		Calendar::Period period_;
	};

} // namespace Model

#endif // MODEL_ONE_OCCURENCE_RULE_HPP
